package com.netease.nie.dao;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import com.netease.nie.mapper.DrawLotteryNormalGoodsInfoMapper;
import com.netease.nie.model.DrawLotteryNormalGoodsInfo;

/**
 * 抽奖普通商品数据操作
 * @author gzlibingjie
 */
@Repository
public class DrawLotteryNormalGoodsInfoDao {
	
	@Resource
	private DrawLotteryNormalGoodsInfoMapper drawLotteryNormalGoodsInfoMapper;
	
	public List<DrawLotteryNormalGoodsInfo> queryByActivityId(Integer activityId) {
		return drawLotteryNormalGoodsInfoMapper.queryByActivityId(activityId);
	}
	
	public DrawLotteryNormalGoodsInfo queryNotDeletedDrawLotteryNormalGoodsInfoById(Integer id) {
		return drawLotteryNormalGoodsInfoMapper.queryNotDeletedDrawLotteryNormalGoodsInfoById(id);
	}
	
	public DrawLotteryNormalGoodsInfo queryDrawLotteryNormalGoodsInfoById(Integer id) {
		return drawLotteryNormalGoodsInfoMapper.queryDrawLotteryNormalGoodsInfoById(id);
	}
	
	public int deductStock(Integer id) {
		return drawLotteryNormalGoodsInfoMapper.deductStock(id);
	}
	
	public List<DrawLotteryNormalGoodsInfo> queryDrawLotteryNormalGoodsInfosByNormalGoodsIds(List<Integer> normalGoodsIds) {
		return drawLotteryNormalGoodsInfoMapper.queryDrawLotteryNormalGoodsInfosByNormalGoodsIds(normalGoodsIds);
	}

}
